<template>
    <div class="ls-card ls-coupon-edit__form m-t-10">
        <div class="nr weight-500 m-b-20">
            福利赠送
            <span class="desc">成为该分销商身份后立马赠送</span>
        </div>
        <el-form ref="form" :model="localForm" label-width="120px" size="small">
            <!-- <el-form-item label="">
                <div class="m-b-10">
                    赠送贡献值<el-input :disabled="$attrs.disabled"  class="ls-input m-l-10" v-model="localForm.contribution"
                        placeholder="">
                        <template slot="append">元</template>
                    </el-input>
                </div>
            </el-form-item> -->
            <el-form-item label="">
                <div class="m-b-10">
                    赠送积分<el-input
                        :disabled="$attrs.disabled"
                        class="ls-input m-l-10"
                        v-model="localForm.points"
                        placeholder=""
                    >
                        <template slot="append">点</template>
                    </el-input>
                </div>
            </el-form-item>
            <!-- <el-form-item label="">
                <div class="m-b-10">
                    赠送余额<el-input :disabled="$attrs.disabled"  class="ls-input m-l-10" v-model="localForm.balance"
                        placeholder="">
                        <template slot="append">元</template>
                    </el-input>
                </div>
            </el-form-item> -->
        </el-form>
    </div>
</template>

<script lang="ts">
//
import { Component, Prop, Ref, Vue, Watch } from 'vue-property-decorator'

import { PageMode } from '@/utils/type'

// import LsDialog from '@/components/ls-dialog.vue'

@Component({
    components: {}
})
export default class distribution_identity_province extends Vue {
    @Prop({
        default() {
            return {}
        }
    })
    welfare!: any

    @Prop({ default: PageMode.ADD }) mode!: string

    localForm: any = {
        contribution: '',
        points: '',
        balance: ''
    }

    @Watch('localForm', { immediate: true, deep: true })
    onLocalFormOnChange() {
        this.emitEvents()
    }

    disabled = false

    created() {
        this.init()
    }

    /** S methods */
    init() {
        // welfare
        const welfare = this.welfare || {}
        this.localForm = Object.assign({}, this.localForm, welfare)
    }
    emitEvents() {
        this.$emit('update:welfare', {
            ...this.localForm
        })
    }
    /** E methods */
}
</script>

<style lang="scss" scoped>
.desc {
    color: #999;
    display: block;
}
</style>
